<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    
    <h:head>
        <title>Facelet Title</title>
       <link href=".SourcePackages/CSS/login.css" type="text/css" rel="stylesheet"/>
    </h:head>
    <h:body>
        <div class="container">
            <h:form id="formlogin">
    <p:growl id="growl" showDetail="true" />
 
    <p:panel header="Ingresar Usuario y Clave" style="margin-bottom:15px">
    </p:panel>
             <h:panelGrid columns="2" cellpadding="5">
            <h:outputLabel for="username" value="Username:" />
            <p:inputText id="username" value="#{userLoginView.username}" required="true" label="username" />
 
            <h:outputLabel for="password" value="Password:" />
            <p:password id="password" value="#{userLoginView.password}" required="true" label="password" />
 
            <f:facet name="footer">
                <p:commandButton value="Login" update="growl" actionListener="#{userLoginView.login}"
                                 oncomplete="handleLoginRequest(xhr, status, args)" />
            </f:facet>  
        </h:panelGrid>
 
            </h:form>
        </div>
        <script type="text/javascript">
    function handleLoginRequest(xhr, status, args) {
        if(args.validationFailed || !args.loggedIn) {
            PF('dlg').jq.effect("shake", {times:5}, 100);
        }
        else {
            PF('dlg').hide();
            $('#loginLink').fadeOut();
        }
    }
</script>
        <br />
        <!--<h:link outcome="welcomePrimefaces" value="Primefaces welcome page" />--> 
        
    </h:body>
</html>

